//
//  TextFieldView.h
//  OCDemo
//
//  Created by zhumuzhi on 2021/7/19.
//

#import <UIKit/UIKit.h>
#import "UITextField+Category.h"

/**
 * 右侧View显示模式
 * RightViewShowTypeNever   不展示
 * RightViewShowTypeEditing 编辑时展示
 * RightViewShowTypeAlways  一直展示
 */
typedef NS_ENUM (NSUInteger, RightViewShowType) {
    RightViewShowTypeNever = 1,
    RightViewShowTypeEditing,
    RightViewShowTypeAlways
};

typedef void (^ textFieldBlock)(UITextField * _Nullable textField);

//typedef void (^ textFieldShouldChangeBlock)(UITextField * _Nullable  textField , _Nonnull NSRange range, NSString * _Nullable string);


NS_ASSUME_NONNULL_BEGIN

@interface TextFieldView : UIView

/**
 * 输入限制长度
 */
@property (nonatomic, assign) NSInteger             limitLegnth;

/**
 * 输入类型
 */
@property (nonatomic, assign) TextFieldInputType    inputType;

/**
 * 圆角
 */
@property (nonatomic, assign) CGFloat               cornerRadius;

/**
 * 右侧View展示模式
 */
@property (nonatomic, assign) RightViewShowType     rightViewMode;

/**
 * 普通状态Image
 */
@property (nonatomic, strong) UIImage *normalImage;

/**
 * 高亮状态Image
 */
@property (nonatomic, strong) UIImage *highlightedImage;

#pragma mark - 事件

@property (nonatomic, copy) textFieldBlock shouldBeginEditingBlock;

@property (nonatomic, copy) textFieldBlock didBeginEditingBlock;

//@property (nonatomic, copy) textFieldShouldChangeBlock textFieldShouldChangeBlock;

@property (nonatomic, copy) textFieldBlock didEndEditingBlock;

@property (nonatomic, copy) textFieldBlock shouldReturnBlock;

@end

NS_ASSUME_NONNULL_END
